<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /**
         * Promise.resolve:
         * 1. 非Promise对象：成功的Promise，参数就是成功的结果值
         * 2. Promise对象：
         *      2-1. 失败的Promise：你失败我也失败，你失败的结果就是我失败的结果
                2-2. 成功的Promise：你成功我也成功，你成功的结果就是我成功的结果
         * 
         * Promise.reject:
         * 
         * 创建一个失败的promise对象
         */
        
        let p1 = new Promise((resolve, reject)=>{
            resolve('ok');
        });

        let p2 = Promise.resolve('ok');



        let p4 = Promise.resolve(new Promise((resolve, reject)=>{
            reject('p4 err');
        }))

        let p5 = Promise.resolve(new Promise((resolve, reject)=>{
            resolve('p5');
        }))

        console.log(p1,p2,p4,p5);




    </script>
</body>
</html>